{include file="public/header" /} {include file="public/menu" /}
<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
    <ul class="layui-tab-title site-demo-title">
        <li  class="layui-this"><a href="{:url('register/index')}">预约列表</a></li>
    </ul>
    <div class="layui-body layui-tab-content site-demo site-demo-body">



        <div class="layui-main">
            <div id="">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                    <legend>筛选</legend>
                </fieldset>
                <form class="layui-form" action="{:url('register/index')}" method="get">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">联系电话</label>
                            <div class="layui-input-inline">
                                <input type="text" name="phone" autocomplete="off" class="layui-input" placeholder="联系电话" value="{$phone}">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">宝宝姓名</label>
                            <div class="layui-input-inline">
                                <input type="text" name="babyname" autocomplete="off" class="layui-input" placeholder="宝宝姓名" value="{$babyname}">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <button class="layui-btn" lay-submit lay-filter="Search">搜索</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>



        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <div id="LAY_preview">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>宝宝姓名</th>
                            <th>宝宝性别</th>
                            <th>生日</th>
                            <th>联系电话</th>
                            <th>填表时间</th>
                            <th>用户ip</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="registers" id="vo"}
                        <tr>
                            <td>{$vo.babyname}</td>
                            <td>{$vo.sex}</td>
                            <td>{$vo.birthday}</td>
                            <td>{$vo.phone}</td>
                            <td>{$vo.addtime}</td>
                            <td>{$vo.ip}</td>

                        </tr>
                        {/volist}
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function data_del(id) {
        layui.use(['layer','laypage'], function() {
            var layer = layui.layer,
                laypage = layui.laypage,
                $ = layui.$;

            laypage.render({
                elem: 'test1' //注意，这里的 test1 是 ID，不用加 # 号
                ,
                count: "50" //数据总数，从服务端得到
            });

            layer.confirm('确定删除？', {
                btn: ['确认', '取消']
            }, function(index, layero) {
                //按钮【按钮一】的回调
                $.post("{:url('register/del')}", { id: id }, function(res) {
                    //res就是返回的结果
                    var res = JSON.parse(res)
                    if (res.status == 200) {
                        layer.msg(res.msg);
                        location.reload();
                    } else {
                        layer.msg(res.msg)
                    }
                });
            }, function(index) {
                //按钮【按钮二】的回调
            });
        })
    }
</script>
{include file="public/footer" /}